import Vue from 'vue';

Vue.filter('filterOrigin', (value) => {
    switch (value) {
        case '1':
            return '毕业生'
        case '2':
            return '朋友'
        case '3':
            return '同事'
        case '4':
            return '网络'
    }
})

function addZero(n){
    return n < 10 ? "0"+ n : "" + n
}

Vue.filter('filterDate', (value) => {
    let t = new Date(value)
    let y = t.getFullYear();
    let m = t.getMonth() + 1;
    let d = t.getDate();
    return y + "-" + addZero(m) + '-' + addZero(d)
})